# -*- encoding=utf-8 -*-

from froModuleDrivers.homeDeviceDriver import HomeDeviceDriver
from froModuleDrivers.nioManager import NioManager
import time

driver_home = HomeDeviceDriver("192.168.4.100", 4001)
manager = NioManager(driver_home)
manager.run()


driver_home.openDoor(2)
time.sleep(1)
driver_home.openRoomFan(3)
time.sleep(1)
driver_home.openCurtain(1)
time.sleep(1)

driver_home.openColorfulLight(5,1,60)
time.sleep(1)
driver_home.openColorfulLight(5,2,50)
time.sleep(1)
driver_home.openColorfulLight(5,3,40)
time.sleep(1)
driver_home.openColorfulLight(5,4,30)
time.sleep(1)
driver_home.openColorfulLight(5,5,20)
time.sleep(1)
driver_home.openColorfulLight(5,6,10)
time.sleep(1)
driver_home.openColorfulLight(5,0,60)
time.sleep(1)

driver_home.closeDoor(2)
time.sleep(1)
driver_home.closeRoomFan(3)
time.sleep(1)
driver_home.closeCurtain(1)
time.sleep(1)

manager.shutdownGracefully()



